Skip to content

fix: drop a player answer that belongs to a file no longer open - #103

Closed
xAlcahest wants to merge 3 commits into
mainfrom
stale-video-answers
Closed

fix: drop a player answer that belongs to a file no longer open#103
xAlcahest wants to merge 3 commits into
mainfrom
stale-video-answers

Conversation

@xAlcahest

Copy link
Copy Markdown
Owner

Summary

useVideoPlayer wrote every answer it got back, whatever file it was about. A command sent against the file that was open could still be in flight when the next one opened, and its refusal then set the player's error state, which puts a sentence on the status bar about a document nobody asked about. Each command now carries the open it belongs to, and an answer arriving with an older one is dropped instead of written.

This was found by reading, while looking for the cause of BACKLOG N40, a check in video-aspect.spec.js that fails on the CI runner and has never failed on this machine. The race is real on its own terms and the fix stands on its own. Whether it is what that check keeps catching is not proven and cannot be proven here: two attempts to reproduce it by taking the audio output away, which is the one difference the runner and this machine are known to have, did not reproduce it. That is written into N40 rather than implied.

Changes

  • src/hooks/useVideoPlayer.ts: an open counter that every command captures before it is sent, and every answer is checked against before it writes state.
  • BACKLOG.md: N40 records what was found, that it is not proven to be the cause, and that a second check joined it on the runner the same day.

How to verify it by using the app

  1. Open a video, then open a second one straight after without waiting for the first to settle.
  2. The status bar says nothing about the first file. Before this change, a command still in flight for it could put "Open a video first." there once the second was open.
  3. Open a file that is not a video. The bar says so, which is the case that must keep working: a refusal about the file you actually opened is still shown.

Verified on Linux: full gate green step by step, and the battery green at 34 spec files of 34. No new check: the race needs two opens to overlap, which the harness cannot drive through the chooser, and a check that cannot be made to redden is not a check.

@xAlcahest

Copy link
Copy Markdown
Owner Author

Folded into #101 and #102: the fix is now the first commit of the chain, where the check it is aimed at can actually see it, and N40's note went with the source column.

@xAlcahest xAlcahest closed this Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant